using System;
using System.Collections.Generic;
using System.Text;
using System.Data;



namespace THSLib
{
    #region STTHSDataSetsController
    /// <summary>
    /// This object represents the properties and methods of a THSDataSet.
    /// </summary>
    public class STTHSDataSetsController:BaseBusinessController
    {
        #region SP Name
        
        //Select By ForeignKey Queries
        private readonly string spGetSTTHSDataSetsBySTFieldID = "STTHSDataSets_SelectBySTFieldID";
        private readonly string spGetMainSTTHSDataSetsBySTFieldID =
                               "STTHSDataSets_SelectMainSTTHSDataSetsBySTFieldID";
        private readonly string spGetSTTHSDataSetsBySTFieldIDAndSTTHSDataSetName =
                               "STTHSDataSets_SelectBySTFieldIDAndSTTHSDataSetName";

        //Delete by foreignkey Queries
        private readonly string spDeleteSTTHSDataSetsBySTFieldID = "STTHSDataSets_DeleteBySTFieldID";

        #endregion

        public STTHSDataSetsController()
        {
            //dal = new STTHSDataSetsDAL();
            dal = new DALBaseProvider("STTHSDataSets", typeof(STTHSDataSetsInfo));
        }                     

        public DataSet GetTHSDataSetByFieldID(int iFieldID)
        {
            return (DataSet)dal.GetDataSet(spGetSTTHSDataSetsBySTFieldID,
                                           iFieldID);            
        }

        public STTHSDataSetsInfo GetMainTHSDataSetByFieldID(int iFieldID)
        {
            return (STTHSDataSetsInfo)dal.GetDataObject(spGetMainSTTHSDataSetsBySTFieldID,
                                                          iFieldID);            
        }

        public STTHSDataSetsInfo GetTHSDataSetByFieldIDAndTHSDataSetName(int iFieldID, String strTHSDataSetName)
        {
            return (STTHSDataSetsInfo)dal.GetDataObject(spGetSTTHSDataSetsBySTFieldIDAndSTTHSDataSetName,
                                                          iFieldID, strTHSDataSetName);            
        }

        public void DeleteTHSDataSetByFieldID(int iFieldID)
        {
            dal.GetDataSet(spDeleteSTTHSDataSetsBySTFieldID,
                           iFieldID);            
        }
    }
    #endregion
}
